Construct sophisticated graphics utilizing + and then convert them with ggplotly
base <-
ggplot(mpg, aes(displ, hwy)) +
geom_point()
p <- base + geom_smooth()
plotly::ggplotly(p)
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'
base <-
ggplot(mpg, aes(displ, hwy)) +
geom_point()
p <- base %+% subset(mpg, fl == "p")
plotly::ggplotly(p)
base <-
ggplot(mpg, aes(displ, hwy)) +
geom_point()
p <- base + list(subset(mpg, fl == "p"), geom_smooth())
plotly::ggplotly(p)
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'